package main;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.*;

public class Player extends Sprite implements KeyListener, Commons {
	private int health = 100;
	private boolean isDead;
	//private int numberOfShots = 10;
	
	public Player(){
		setX(300);
		setY(520);
		this.isDead = false;
	}

	public void act(){
		move(dx,0);
	}
	
	public void keyPressed(KeyEvent e) {
        switch(e.getKeyCode()){
        case KeyEvent.VK_LEFT: 
        	dx = 10;
        	break;
        case KeyEvent.VK_RIGHT: 
        	dx= -10;
        	break;
        case KeyEvent.VK_R:
        	//restart
        	break;
        case KeyEvent.VK_SPACE:
        	//shot
        	break;
        }
	}
 	
	public void keyReleased(KeyEvent e)	{
 		switch(e.getKeyCode()){
		case KeyEvent.VK_LEFT:
 			dx = 0;
 			break;
 		case KeyEvent.VK_RIGHT:
 			dx = 0;
 			break;
 		}
  	} 
	
 	public void keyTyped(KeyEvent e)	{} 
	
}
